// 日历
import React from 'react'
import { Lunar } from 'lunar-javascript';

const HomeCalendar = () => {

    const currentDate = new Date();
    const year = currentDate.getFullYear();
    const month = currentDate.getMonth() + 1;
    const day = currentDate.getDate();

    var d = Lunar.fromDate(new Date());//获取农历日期
    let lunarMonth = d.getMonthInChinese();//获取中文 月
    let lunarDay = d.getDayInChinese();//获取中文 日
    let week = d.getWeekInChinese();//获取中文 周

    // var l = d.getFestivals(); // 获取国内国际节日
    // for (var i = 0, j = l.length; i < j; i++) {
    //     console.log(l[i]);
    // }

    
    return (
        <>
            <div>
                <b><span style={{ fontSize: '23px' }}>{day}</span>/{month}&nbsp;&nbsp;{year}</b>
                <p style={{ fontSize: '12px', color: '#969696' }}>周{week}&nbsp;农历{lunarMonth}月{lunarDay}</p>
            </div>
            <div>

            </div>
        </>
    )
}

export default HomeCalendar